package com.yuntongxun.ecdemo.voicechat.ui.activity;

import android.content.Intent;
import android.support.v7.widget.CardView;

import com.yuntongxun.ecdemo.R;
import com.yuntongxun.ecdemo.voicechat.bean.PostResult;
import com.yuntongxun.ecdemo.voicechat.comman.EventBusTags;

import butterknife.OnClick;

/**
 * 选择登录 注册的页面
 * @author danny
 * @version 1.0
 * @since 2016/11/14
 */

public class LoginOrRegisterActivity extends BaseChatActivity {



    @Override
    protected boolean isBindEventBusHere() {
        return true;
    }

    @Override
    protected int getContentViewLayoutID() {
        return R.layout.activity_login_or_register;
    }

    @Override
    protected void initViewsAndEvents() {

    }

    @OnClick({R.id.register_btn,R.id.login_btn})
    public void onclick(CardView button){
        switch (button.getId()){
            case R.id.register_btn:
                startActivity(new Intent(LoginOrRegisterActivity.this,RegisterFlagActivity.class));
                break;
            case R.id.login_btn:
                startActivity(new Intent(LoginOrRegisterActivity.this,VoiceChatLoginActivity.class));
                break;
        }
    }

    public void onEvent(PostResult postResult){
        if (EventBusTags.REGISTER_FINISH.equals(postResult.getTag())){
          finish();
        }
    }

}
